package com.inspur.config;

import feign.Feign;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;


//此配置类为了关闭特定Feign客户端的Hystrix支持
@Configuration
public class FeignNoHystrixConfigure {

    // FeignClientsConfiguration 的默认配置如下
    // Decoder feignDecoder: ResponseEntityDecoder (which wraps a SpringDecoder)
    // Encoder feignEncoder: SpringEncoder
    // Logger feignLogger: Slf4jLogger
    // Contract feignContract: SpringMvcContract Feign.Builder
    // feignBuilder: HystrixFeign.Builder Client
    // feignClient: if Ribbon is enabled it is a LoadBalancerFeignClient, otherwise the default feign client is used.

    @Bean
    @Scope("prototype")
    public Feign.Builder feignBuilder(Retryer retryer) {
        return Feign.builder();
    }

}
